import request from '@/utils/request'

/**
 * 获取协同标绘列表
 * @param {*} query 
 * @returns 
 */
export function getSynMarkerList(query) {
  return request({
    url: '/oa/plot/list',
    method: 'get',
    params: query
  })
}

/**
 * 获取协同标绘详情
 * @param {*} plotId 
 * @returns 
 */
export function getSynMarkerInfo(plotId) {
  return request({
    url: '/oa/plot/' + plotId,
    method: 'get'
  })
}

/**
 * 保存协同标绘
 * @param {*} data 
 * @returns 
 */
export function saveSynMarker(data) {
  return request({
    url: '/oa/plot',
    method: data.plottingId == 0 ? 'post' : 'put',
    data: data
  })
}

/**
 * 获取标绘历史数据
 * @param {*} plotId 
 * @returns 
 */
export function getHistoryMarkers(plotId) {
  return request({
    url: '/oa/point/list',
    method: 'get',
    params: { plottingId: plotId }
  })
}

/**
 * 删除一个标绘图层
 * @param {*} pointId 
 * @returns 
 */
export function delMarker(pointId) {
  return request({
    url: '/oa/point/' + pointId,
    method: 'delete',
  })
}

/**
 * 获取协同标绘在线用户
 * @param {*} plotId 
 * @returns 
 */
export function getSynMarkerUsers(plotId) {
  return request({
    url: '/oa/plot/onlineUser/' + plotId,
    method: 'get'
  })
}